<script lang="ts" setup>
import { onMounted, defineEmits, defineProps } from "vue";
const emit = defineEmits(["event"]);
const props = defineProps({
  content: String,
});
import E from "wangeditor";

onMounted(() => {
  const editor = new E("#myeditor");
  editor.create();
  props.content && editor.txt.html(props.content);
  editor.config.onchange = function (newHtml: any) {
    emit("event", newHtml);
  };
});
</script>
<template>
  <div id="myeditor"></div>
</template>
